const { defineConfig } = require('@vue/cli-service')
const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')

module.exports = defineConfig({
  transpileDependencies: true,
  // publicPath: './',
  // lintOnSave: false // 关闭elisnt检查
  configureWebpack: {
    resolve: {
      alias: {
        components: '@/components',
        views: '@/views',
        assets: '@/assets'
      }
    },
    plugins: [
      AutoImport({
        // 自动导入element-plus组件
        resolvers: [ElementPlusResolver()]
      }),
      Components({
        // 自动注册element-plus组件
        resolvers: [ElementPlusResolver()]
      })
    ]
  }
})
